package com.hfy.music.controller;

import com.hfy.model.dto.LikeDto;
import com.hfy.music.service.LikeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import result.Result;

/**
 * @ author 韩
 * time: 2024/5/24 3:33
 */
@RestController
@Tag(name = "个人音乐信息的接口类" ,description = "主要是对个人音乐信息的一些处理操作，其实也可以放到音乐里，但是我的音乐，强调的是我的，而不是音乐，应该是由点及面")
public class LikeController {

    @Autowired
    private LikeService likeMusicService;

    @PostMapping("/like")
    @Operation(summary = "喜欢或取消喜欢歌曲或者评论")
    @Parameters({@Parameter(name = "account", description = "账号"),
            @Parameter(name = "biz", description = "业务类型"),
            @Parameter(name = "bizId", description = "音乐ID或者评论ID")
    })
    public Result like(@RequestBody LikeDto dto) {

        return likeMusicService.like(dto.getAccount(),dto.getBiz(),dto.getBizId());

    }

}
